package com.imti.mall.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.imti.mall.model.pms.pojo.PmsBrand;
import com.imti.mall.model.pms.vo.PmsBrandVo;
import com.imti.mall.product.dao.PmsBrandDao;
import com.imti.mall.product.service.PmsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * ClassName: PmsBrandServiceImpl
 * Description:
 * date: 2022/9/13 11:38
 *
 * @author: youhun
 * @version:
 * @since JDK 1.8
 */
@Service
public class PmsBrandServiceImpl extends ServiceImpl<PmsBrandDao, PmsBrand> implements PmsBrandService {

    @Autowired
    private PmsBrandDao pmsBrandDao;

    @Override
    public boolean addPmsBrand(PmsBrand pmsBrand) {
        return save(pmsBrand);
    }

    @Override
    public boolean updatePmsBrandById(PmsBrandVo pmsBrand) {
        return  pmsBrandDao.updatePmsBrand(pmsBrand);
    }

    @Override
    public boolean deletePmsBrandById(Integer Id) {
        return removeById(Id);
    }

    @Override
    public List<PmsBrand> findPmsBrand(PmsBrand pmsBrand, Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        return pmsBrandDao.findPmsBrand(pmsBrand);
    }

    @Override
    public PmsBrand getPmsBrandById(Integer Id) {
        return getById(Id);
    }

    @Override
    public Integer getPmsBrand(PmsBrand pmsBrand) {
        return pmsBrandDao.getPmsBrand(pmsBrand);
    }
}
